package com.training.exceptions;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.util.ArrayList;
import java.util.Scanner;

public class ExceptionTest {
	
	public static void main(String[] args)  {
		 
		
		try{
		
		 Scanner scanner = new Scanner(System.in);
		 System.out.println("Enter Number 1:");
		 int firstNum  = scanner.nextInt();
		 System.out.println("Enter Number 2 :");
		 int secondNum;
		 boolean isCorrectNumber = true;
		 do{
			  
			 secondNum  = scanner.nextInt();
			 
		 if(secondNum == 0)
		 {
			 System.out.println("Second Number should not be null ---");
			 
		 }
		 else
		 {
			
			 isCorrectNumber = false;
		 }
	 	 }
		 while (isCorrectNumber);
 		 int result = firstNum/secondNum;
		 System.out.println("Result is  - "+result);
		 
		 BufferedReader bufferedReader = new BufferedReader(new FileReader(new File("C:\\work\\noFile.txt")));
		 
		 ArrayList employeeList = null;
		 if(employeeList != null)
		 {
			 System.out.println("Add Employee Naresh to Employee List");
		 employeeList.add("Naresh");
		 
		 }
		 
		 else
		 {
			 System.out.println("NO Employees Available");
		 }
		} 
		catch(FileNotFoundException  fileNotFoundException)
		{
			System.out.println("Opps ...File is not Exists ");
		}
		
		catch(Exception exception)
		{
			
			System.out.println("Opps We got exception - "+exception.getMessage());
		}
		 
		 
		 System.out.println("I want to execute more statments below --------------");
		
		
		 
		
		
		  
		 
		 
		 
		 
	}
	
}
